#!/bin/sh
cd /opt/gitee/jeepay/jeepay
pwd
git reset --hard
git pull
mvn clean package -Dmaven.test.skip=true -Ptest
#mvn clean package依次执行了clean、resources、compile、testResources、testCompile、test、jar(打包)等７个阶段。
#mvn clean install依次执行了clean、resources、compile、testResources、testCompile、test、jar(打包)、install等8个阶段。
#mvn clean deploy依次执行了clean、resources、compile、testResources、testCompile、test、jar(打包)、install、deploy等９个阶段。
#
#
#package命令完成了项目编译、单元测试、打包功能，但没有把打好的可执行jar包（war包或其它形式的包）布署到本地maven仓库和远程maven私服仓库
#install命令完成了项目编译、单元测试、打包功能，同时把打好的可执行jar包（war包或其它形式的包）布署到本地maven仓库，但没有布署到远程maven私服仓库
#deploy命令完成了项目编译、单元测试、打包功能，同时把打好的可执行jar包（war包或其它形式的包）布署到本地maven仓库和远程maven私服仓库


#取消cp的 alias
unalias cp

#更新了app.sh
cp -rf /opt/gitee/jeepay/jeepay/docs/script/app.sh /home/jeepay/service/manager
dos2unix  /home/jeepay/service/manager/app.sh

cp -rf /opt/gitee/jeepay/jeepay/docs/script/app.sh /home/jeepay/service/merchant
dos2unix  /home/jeepay/service/merchant/app.sh

cp -rf /opt/gitee/jeepay/jeepay/docs/script/app.sh /home/jeepay/service/payment
dos2unix  /home/jeepay/service/payment/app.sh

#更新了application.yml
cp -rf /opt/gitee/jeepay/jeepay/conf/manager/application.yml /home/jeepay/service/manager
cp -rf /opt/gitee/jeepay/jeepay/conf/merchant/application.yml /home/jeepay/service/merchant
cp -rf /opt/gitee/jeepay/jeepay/conf/payment/application.yml /home/jeepay/service/payment


#更新了jar
cp -rf /opt/gitee/jeepay/jeepay/jeepay-manager/target/jeepay-manager.jar /home/jeepay/service/manager
cp -rf /opt/gitee/jeepay/jeepay/jeepay-merchant/target/jeepay-merchant.jar /home/jeepay/service/merchant
cp -rf /opt/gitee/jeepay/jeepay/jeepay-payment/target/jeepay-payment.jar /home/jeepay/service/payment

chmod 777 /opt/gitee/jeepay/jeepay/*.sh
#打印时间
currTime=$(date +"%Y-%m-%d %T")
echo $currTime
echo "------done---------"